package com.wxzhou.wangzhuan.entity;

/**
 * 广告网络
 */
public enum AdChannel {
    TOBID(0, "tobid"),
    QB(1, "趣变"),
    GROMORE(2, "gromore"),
    OTHER(3, "其他");

    private final int code;
    private final String description;

    AdChannel(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static AdChannel fromCode(int code) {
        for (AdChannel status : values()) {
            if (status.code == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown ad sense code: " + code);
    }

}
